var assert = require('assert');

describe('array', function () {
    let arr = []
    before(function(done) {
        setTimeout(() => {
            console.log('before 01 ----')
            done()
        }, 1000)
    });

    after(function(done) {
        setTimeout(() => {
            console.log('after 01 ----')
            done()
        }, 1000)        
    });

    beforeEach(() => {
        console.log('beforeEach 01 ----')
        arr = [1, 2, 3]
    });

    afterEach(() => {
        console.log('afterEach 01 ----')
        arr = [1, 2, 3]
    });

    it('indexOf', function (done) {
        setTimeout(() => {
            assert.deepStrictEqual(arr.indexOf(1), 0)
            assert.deepStrictEqual(arr.indexOf(4), -1)
            done()
        }, 1000)
    })

    it('map', function () {
        assert.deepStrictEqual(arr.map(x => x*x), [1, 4, 9])
    })

})